﻿//
// Copyright (c) 2024 BPer
//
#ifndef BPERTHREAD_H
#define BPERTHREAD_H
#include <QThread>
#include <QVector>

#include "BPerPlayWidget.h"
#include "BPerYuvPlayWidget.h"
#include <bperplayer/BPerWinPlayFactroy.h>
#include <bperutil/buffer/BPerVideoBuffer.h>
#include <video/BPerrecordvideowin.h>

class BPerRecordThread : public QThread
{
public:
    BPerRecordThread();
    virtual ~BPerRecordThread();
     int32_t m_isLoop;
    void initPara(BPerContext *par);

#if BPer_OS_APPLE
    BPerYuvPlayWidget *m_video;
#else
    BPerPlayWidget *m_video;
#endif
    BPerVideoBuffer *m_videoBuffer;
    int32_t m_sid;
    void stopAll();
    int32_t showType;

private:
    void render();
    void closeAll();

    //void initPlaySdl(BPerRecordThreadWin *pwin);
    int32_t m_isStart;
    BPerColor m_bgColor;
    BPerColor m_textColor;
    int32_t m_videoPlayNum;
    BPerContext *m_para;
    BPerFrame m_frame;

private:
    virtual void run();
};

#endif // BPERTHREAD_H
